home *** CD-ROM | disk | FTP | other *** search
- -----------------------------------------------------------------------------
- 14th July 1992
- -----------------------------------------------------------------------------
- Support Group Application Note
- Number: 201
- Issue: 1
- Author: James Bye
- -----------------------------------------------------------------------------
-
- Scrap Files - the use of !Scrap and ScrapFile storage
-
- -----------------------------------------------------------------------------
- Applicable Hardware: All Acorn RISC OS based computers
-
- Related Application Notes:
-
-
- -----------------------------------------------------------------------------
- Copyright (C) Acorn Computers Limited 1992
-
- Every effort has been made to ensure that the information in this leaflet is
- true and correct at the time of printing. However, the products described in
- this leaflet are subject to continuous development and improvements and
- Acorn Computers Limited reserves the right to change its specifications at
- any time. Acorn Computers Limited cannot accept liability for any loss or
- damage arising from the use of any information or particulars in this
- leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
- Limited.
- -----------------------------------------------------------------------------
- Support Group
- Acorn Computers Limited
- Acorn House
- Vision Park
- Histon
- Cambridge CB4 4AE
- -----------------------------------------------------------------------------
-
- Due to the requirements of single floppy and network users with regards to
- temporary file storage, it was important that a definite step was put
- forward in the area of scrap file storage. Originally, scrap files where
- stored inside the !System application but the scrap file part has been
- removed and placed inside its own application, !Scrap.
-
-
- History
-
- With older applications the system variable <Wimp$Scrap> was used to ensure
- that scrap files were placed inside the !System directory. Applications
- which use this variable will function correctly when !Scrap is used, as
- !Scrap simply redirects the file from !System to itself. Files generated in
- this manner invariably use the name Scrapfile.
-
- Some developers allowed an application to create multiple scrap files.
- Others were worried that another application may overwrite the newly created
- scrap file with other data. This led to the situation were applications
- explicitly directed scrap files into the !System directory, via the use of
- <System$Path>, and created unique names, based on the application name, for
- scrap files.
-
- This method is, of course, fine until the application is placed on a
- network. There may then be a number of users sharing the same !System. The
- situation previously described reappears.
-
-
- About !Scrap
-
- !Scrap gives the computer somewhere to store temporary files. Applications
- often use temporary files during copying or saving; however these files are
- always deleted when they are no longer needed.
-
- Hard disc users should always store !Scrap in the root directory of their
- hard disc. This is so !Scrap is always seen when the root directory is
- catalogued.
-
- Floppy disc users should keep a copy of !Scrap on every floppy that contains
- an application. This may seem wasteful of disc space, but scrap only takes
- up minimal space when not in use. Also keeping !Scrap on every 'work' disc
- will eliminate the need for constant disc swapping, as long as you are using
- the !Scrap on the current floppy disc (this can be achieved by double
- clicking on the new !Scrap each time a new disc is place in the drive).
-
- On a network, a copy of !Scrap should be placed in each user's root
- directory. Do not worry about multiple users using the same user's root
- (e.g. 5 different stations logged on as user 'Geography') as !Scrap is
- intelligent enough to create scrap directories for each logged on user.
-
- With current copies of !Scrap the directory ScrapDir is used, unless the
- pathname indicates that it is stored on a network, in which case the network
- and station number are used to generate a unique directory name. The name is
- displayed thus:
-
- Stn021!210
- Where
- Stn021 is used to ensure that the directories appear at the same point
- in the directory catalogue.
-
- 021 is the network number.
-
- ! is used as a separator.
-
- 210 is the station number.
-
- So a directory titled Stn002!140 would indicate that this is the scrap file
- area for station 140 on network 2.
-
-
- Writing applications which use !Scrap
-
- When writing an application which needs to generate scrap files there are a
- number of basic rules which should be obeyed. These are:
-
- If there will only ever be a single scrap file created by the
- application
- then use a name which is unique.
-
- If there are likely to be multiple scrap files generated by the
- application, then create a directory inside the scrap area into
- which the application can place its scrap files. If you do need to
- create such a directory then you should register the name of the
- directory with Developer Support.
-
- It is important that the correct lines are also appended to the !Run file of
- your application. The lines that are appended depend on how scrap files are
- going to be used.
-
-
- Single scrap files
-
- When your application only deals with single scrap files, the following
- commands should be appended to your !Run file :-
-
- If "<Wimp$ScrapDir>" = "" Then Error 0 !Scrap has not been run.
- Please locate !Scrap. Else SetMacro App1$Scrap <Wimp$ScrapDir>.App1
-
- The system variable App1$Scrap should, of course, be replaced with a name
- which is appropriate to the application in question.
-
- !Scrap will then have a structure as follows :-
- (diagram 1)
-
-
- Multiple scrap files
-
- When your application deals with multiple scrap files, the following
- commands should be appended to your !Run file :-
-
- If "<Wimp$ScrapDir>" = "" Then Error 0 !Scrap has not been run.
- Please locate !Scrap. Else Set App1$Scrap <Wimp$ScrapDir>.App1
- |
- If "<Wimp$ScrapDir>" > "" Then CDir <Wimp$ScrapDir>.App1
-
- The variables App1$Scrap and App1 should, of course, be replaced with a name
- which is appropriate to the application in question.
-
- !Scrap will then have a structure as follows :-
- (diagram 2)
-
-
- Possible Errors
-
- Applications that transfer files via scrap files will generate errors if
- !Scrap has not been seen. The possible errors are as follows :-
-
- "Can't transfer file" - This means that !Scrap has not been seen be by the
- filer. Showing the filer !Scrap, or double
- clicking on it will solve this.
-
- "Protected disc" - This means that the current 'scrap' disk has been
- write protected and the scrap file cannot be
- written. This can be solved bu un-protecting the
- disk, or using !Scrap from another, unprotected
- disk.
-
-
- Supplying !Scrap with third party products
-
- If your application uses Scrap files, be it for temporary or longer term
- storage, then you will need to supply !Scrap with your application. The
- latest version of !Scrap should be distributed with a copy of !Merge (an
- application merging tool) so the user can update/install accordingly.
-
- The current version of !Scrap is v0.56 (2-Aug-1991). If you do not have a
- copy of this version or a copy of !Merge, both are available via developer
- support on request.
-
- If you have any questions about scrap files that are not covered by the
- above, then please contact developers support. If you are unsure about the
- way you have implemented your scrap files (especially when dealing with
- longer term scrap storage) it is better to be safe and contact developer
- support to check that you are doing things correctly.
-
-
-